home *** CD-ROM | disk | FTP | other *** search
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ; BCNUKE.PPE by Drew [PWA]
- ; Last updated 12-3-94
- ;
- ; This was originally PWANUKE.PPE from BlackCat's Nuker. It is slightly
- ; modified to work more smoothly with EFLAG, including using USERS.CFG to
- ; control access to flag-nuking access. USERS.CFG simply contains all user
- ; names which you wish to allow flagging files for nuking, one user name
- ; per line.
- ;
- ; To install, copy BCNUKE.PPE and BCNUKE.CFG into any directory (the most
- ; logical ones would be in the same directory as EFLAG or the same directory
- ; where the nuker is). Edit BCNUKE.CFG and put the full pathname to
- ; BlackCat's nuker in it. See the nuker docs for more details. Finally,
- ; edit either PROMPT1.CFG and/or PROMPT2.CFG to have a command point at this
- ; PPE. See either of those two config files for more instructions.
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
- ; Use this PPE to nuke files when using PWA flag by Drew.
- ; Install this PPE in EFLAG.CFG as an external command. It's all explained
- ; in EFLAG.CFG.
-
- string nukecfg, nukefile, filename, dirnr
- filename = gettoken()
- nukecfg = ppepath() + "bcnuke.cfg"
-
- if (!exist(nukecfg)) then
- freshline
- println "Error: Flag.ppe is setup to use NUKE.PPE but cannot"
- println "find BCNUKE.CFG, please contact sysop"
- end
- endif
-
-
- string line
- boolean allowed
-
-
- ; now check if the user online is even allowed to nuke files
- ;
- allowed = FALSE
- if (exist(ppepath() + "USERS.CFG")) then
- getuser
- fopen 1, ppepath() + "USERS.CFG", O_RD, S_DW
- fget 1, line
- while (!ferr(1)) do
- if (upper(line) == upper(u_name())) then
- allowed = TRUE
- fclose 1
- break
- endif
- fget 1, line
- endwhile
- fclose 1
- endif
-
- if (allowed == FALSE) then
- print "@X0CSorry, you are not allowed to nuke files.@X07"
- delay 25
- newline
- end
- endif
-
-
-
- nukefile = readline(nukecfg, 1) + "\work\bcnk" + string(curconf()) +"."+ \
- string(pcbnode())
-
- if (upper(readline(nukefile, 1)) <> u_name()) then
- fclose -1
- delete nukefile
- fappend 1, nukefile, O_WR, S_DN
- fputln 1, u_name()
- else
- fclose -1
- fappend 1, nukefile, O_WR, S_DN
- endif
- dirnr = string(pcbmac("@DIRNUM@"))
-
- ; oops, assume upload dir, there's nothing we can do
- if (dirnr == "") then
- dirnr = string(pcbmac("@NUMDIR@"))
- endif
-
- if (filename <> "") fputln 1, filename + " " + dirnr
- fclose 1
- print "@X0CFile flagged for nuking. Don't forget to run NUKE!@X07"
- delay 25
-
-